package cn.javass.dp.strategy.selfexample;

/**
 * Created by wanggen on 19/7/25.
 */
public class CashRebate extends CashSuper {

    private double moneyRebate = 1d;

    //初始化时，必需要输入折扣率,如八折，就是0.8
    public CashRebate(double moneyRebate) {
        this.moneyRebate = moneyRebate;
    }

    @Override
    public double acceptCash(double money) {
        double result = money * moneyRebate;
        System.out.println("CashRebate:"+result);
        return result;
    }
}
